﻿using System;

namespace Tumblr.API
{
    public class Account
    {
        public Account(string email, string password)
        {
            IsPrivate = false;
            Email = email;
            Password = password;
            DateOfPost = DateTime.Now;
        }

        public string Email { get; set; }

        public string Password { get; set; }

        public bool IsPrivate { get; set; }

        public DateTime DateOfPost
        {
            get
            {
                return Convert.ToDateTime(StrDateOfPost);
            }
            set
            {
                if (value > DateTime.Now)
                {
                    StrDateOfPost = "";
                }
                else
                {
                    StrDateOfPost = value.ToString("yyyy-MM-dd HH:mm:ss");
                }
            }
        }

        public string StrDateOfPost { get; set; }
    }
}